package dormouse.vfs.ui.renderers;

import java.awt.Component;

import javax.media.bean.playerbean.MediaPlayer;

import org.apache.commons.vfs2.FileObject;

/**
 * This class is responsible for rendering media files. 
 * 
 * @author Mark
 *
 */
public class MediaRenderer extends MediaPlayer implements IFileRenderer {
	
	private static final String[] EXTS = {"mpg", "mpeg", "mp4","mp3"};
	
	public MediaRenderer(){
		
	}

	/**
         * {@inheritDoc }
         */
	public void render(FileObject file) {
		this.setMediaLocation(file.getName().getURI());
	}
        
	/**
         * {@inheritDoc }
         */
    public String[] getFileExtensions() {
       return EXTS;
    }

    public Component getComponent() {
       return this;
    }
        
        

}
